import { config } from "../config";
let LocalStorage = require('node-localstorage').LocalStorage;
let localStorage = new LocalStorage(config.dataRootDir + '/settings');

var configs: any = {
    get: function (key) {
        return localStorage.getItem(key);
    },
    set: function (key, val) {
        return localStorage.setItem(key, val);
    },
    get lastSyncTimeKey() {
        return localStorage.getItem('system.lastSyncTimeKey');
    },
    set lastSyncTimeKey(val) {
        localStorage.setItem('system.lastSyncTimeKey', val);
    },
    get teminalBindId() {
        return localStorage.getItem('system.teminalBindId');
    },
    set teminalBindId(val) {
        localStorage.setItem('system.teminalBindId', val);
    },
    get lastStartInfo() {
        return localStorage.getItem('system.lastStartInfo');
    },
    set lastStartInfo(val) {
        localStorage.setItem('system.lastStartInfo', val);
    }
};

module.exports = configs